import React from 'react';

export interface IRouleManageContext {
  curRes: any;
  prefixCls: string;
  tableData: any[];
  tableLoading: boolean;
  searchTableValue: string;
  expandedRowKeys: string[];
  checkedRowKeys: string[];
  rouleDispatch: React.Dispatch<any>;
  reloadRoleTableState: () => void;
  detailMenuLeftValue: string;
  roleDetailRightValue: string;
  // roleCurrentKey: string
  // roleCurrentIndex: number
}

const INIT_ROLEMANAGE_VALUE: IRouleManageContext = {
  prefixCls: '',
  curRes: {},
  tableData: [],
  tableLoading: false,
  searchTableValue: '',
  expandedRowKeys: [],
  rouleDispatch: () => {},
  checkedRowKeys: [],
  reloadRoleTableState: () => {},
  detailMenuLeftValue: '',
  roleDetailRightValue: '',
  // roleCurrentKey: 'setMenu',
  // roleCurrentIndex: 0
};

export const RouleManageContext = React.createContext<IRouleManageContext>(
  INIT_ROLEMANAGE_VALUE,
);
